global widgetSession

import gtk
import conf
from engine import Widgets
import PopupMenuNew

class UI(Widgets):
    
    def __init__(self,):
        Widgets.__init__(self)
        self.__widget = gtk.StatusIcon()
        self.menu = PopupMenuNew.genericPopupMenu()
        self.__set("Absynth FTP", "gtk-network")
        
    def __set(self, name, icon):
        self.__widget.set_tooltip(name)
        #self.__widget.set_from_stock(icon)
        self.__widget.set_from_file(conf.DATA_DIR + "/img/logo_minimal.png")
        
    def connectMenuEvent(self, info, exit):
    	self.menu.addSimpleEntry("Informazioni", "Informazioni su Absynth", gtk.STOCK_NEW, "<control>I", "I", info)
        self.menu.addSimpleEntry("Chiudi", "Chiudi Absynth", gtk.STOCK_NEW, "<control>C", "C", exit)
        
       # self.__widget.connect("popup-menu", self.menu.eventHandler, self.menu.widget)
    #	self.menu.linkTo(self.__widget)
       
    def newFTPMenu(self, data):
        self.menu.createMenu([
            ("Informazioni", "Informazioni su Absynth", gtk.STOCK_NEW, "<control>I", "I", info),
            ("Chiudi", "Chiudi Absynth", gtk.STOCK_NEW, "<control>C", "C", exit),
        ])